package com.designpattern.createpattern.demo03;

import java.util.HashMap;
import java.util.Map;

public class PizzaFactory {
    private static final Map<String, Pizza> map = new HashMap<>();
    static {
        map.put("apple", new ApplePizza());
        map.put("banana", new BananaPizza());
    }
    public Pizza createPizza(String type){
        return map.get(type);
    }
}
